<?php
/**
 * @Notes:【】
 * @User: zwc
 * @Date: 2022-05-06 17:58
 */

namespace App\Listener\WebSocket;

use App\Event\Talk\ChatEvent;
use App\Event\TalkConnectEvent;
use App\WsService\Chat\ChatSessionService;
use App\WsService\Message\ChatService;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;

/**
 * @Listener()
 */
class TalkConnectListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            TalkConnectEvent::class
        ];
    }


    public function process(object $event)
    {
        switch ($event->from) {
            case 'game':
                break;
            default:
                App(ChatService::class)->SendUnReadNum($event->uid);
                App(ChatSessionService::class)->lists($event->uid);
        }


    }

}